
import java.util.*;

public class Main1{
    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        String s1 = sc.next();
        String s2 = sc.next();
        int count = 0;
        for(int i=0;i<=s1.length();i++) {
            StringBuffer s3 = new StringBuffer(s1);
            s3.insert(i,s2);
            //判断回文
            StringBuffer tmp = new StringBuffer(s3);
            tmp.reverse();
            if( s3.toString().equals(tmp.toString())) {
                count++;
            }
        }
        System.out.println(count);

    }
}